function centerWindowOnScreen() {

	var browserWidth = 0, browserHeight = 0;
	if (typeof (window.innerWidth) == 'number') {
		// Non-IE
		browserWidth = window.innerWidth;
		browserHeight = window.innerHeight;
	} else if (document.documentElement
			&& (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
		// IE 6+ in 'standards compliant mode'
		browserWidth = document.documentElement.clientWidth;
		browserHeight = document.documentElement.clientHeight;
	} else if (document.body
			&& (document.body.clientWidth || document.body.clientHeight)) {
		// IE 4 compatible
		browserWidth = document.body.clientWidth;
		browserHeight = document.body.clientHeight;
	}

	var xOffset = 0, yOffset = 0;
	if (typeof (window.pageYOffset) == 'number') {
		// Netscape compliant
		yOffset = window.pageYOffset;
		xOffset = window.pageXOffset;
	} else if (document.body
			&& (document.body.scrollLeft || document.body.scrollTop)) {
		// DOM compliant
		yOffset = document.body.scrollTop;
		xOffset = document.body.scrollLeft;
	} else if (document.documentElement
			&& (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
		// IE6 standards compliant mode
		yOffset = document.documentElement.scrollTop;
		xOffset = document.documentElement.scrollLeft;
	}

	var modalWindow = Wicket.Window.get();

	if (modalWindow) {
		var wWidth = modalWindow.window.offsetWidth;
		var wHeight = modalWindow.window.offsetHeight;

		var top = (browserHeight - wHeight) / 2 + yOffset;
		var left = (browserWidth - wWidth) / 2 + xOffset;

		modalWindow.window.style.top = top + "px";
		modalWindow.window.style.left = left + "px";
	}
}